package com.stox.shared.model.intf;

import java.util.Comparator;

public interface Ordered {

	public static final class OrderedComparator implements Comparator<Ordered>{
		@Override
		public int compare(Ordered o1, Ordered o2) {
			if(null == o1){
				if(null == o2){
					return 0;
				}else{
					return -1;
				}
			}else{
				if(null == o2){
					return 1;
				}else{
					return o1.getOrder() == o2.getOrder() ? 0 : o1.getOrder() > o2.getOrder() ? 1 : -1;
				}
			}
		}
	}
	
	public int getOrder();
	
}
